<template>
  <div>
    <div class="title">
      <div class="title-t">
        <img
          src="../assets/客户中心/列表箭头.png"
          width="8"
          alt=""
          @click="goback"
        />
        <p>客户详情</p>
        <img src="../assets/客户中心/首页按钮.png" width="15" alt="" />
      </div>
      <div class="title-b">
        <div>
          <img src="../assets/客户中心/头像.png" width="60" alt="" />
          <p>{{ text.custName }}</p>
        </div>
        <div @click="gocustomerBJ">
          <img src="../assets/客户中心/编辑信息.png" width="25" alt="" />
          编辑信息
        </div>
      </div>
      <div class="title-text">
        <img src="../assets/客户中心/底纹.png" width="99%" alt="" />
        <div class="nerong">
          <div class="nerong-title">
            <img src="../assets/客户中心/基本信息.png" width="20" alt="" />
            <p>基本信息</p>
          </div>
          <ul>
            <li>
              客户名称 <span>{{ text.custName }}</span>
            </li>
            <li>
              联系电话 <span class="spanx">{{ text.telephone }}</span>
            </li>
            <li class="tesu">
              学历 <span>{{ text.education }} </span>
            </li>
            <li class="tesu">
              性别 <span>{{ text.sex }}</span>
            </li>
            <li class="tesu">
              年龄 <span>{{ text.age }}</span>
            </li>
            <li>
              所属城市 <span>{{ text.cityName }}</span>
            </li>
            <li>
              公司名称 <span>{{ text.company }}</span>
            </li>
            <li class="tesu">
              职位 <span>{{ text.position }}</span>
            </li>
            <li>
              录入时间 <span>{{ text.createTime }}</span>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { custXQ } from "../request/api";
export default {
  data() {
    return {
      id: "",
      //内容
      text: {},
    };
  },
  created() {
    this.id = this.$route.query.id;
    // console.log(this.id);
    custXQ({
      id: this.id,
    }).then((res) => {
    //   console.log(res.data);
      this.text = res.data;
    });
  },
  methods: {
    goback() {
      this.$router.push({
        path: "/customer",
        query: {
          id: this.id,
        },
      });
    },
    gocustomerBJ() {
      this.$router.push({
        path: "/customerBJ",
        query: {
          id: this.id,
          text:this.text
        },
      });
    },
  },
};
</script>
 
<style lang = "less" scoped>
.title {
  width: 100%;
  height: 200px;
  background-color: #003399;
  box-sizing: border-box;
  position: relative;
  .title-t {
    display: flex;
    justify-content: space-between;
    padding: 20px 10px;
    box-sizing: border-box;
    align-items: center;
    color: #fff;
    img:nth-of-type(1) {
      transform: rotate(180deg);
    }
  }
  .title-b {
    display: flex;
    justify-content: space-between;
    align-items: center;
    div:nth-of-type(1) {
      margin-left: 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      color: #fff;
      font-size: 18px;
      p {
        margin-left: 10px;
      }
    }
    div:nth-of-type(2) {
      display: flex;
      align-items: center;
      color: #ccc;
      background-color: rgba(255, 255, 255, 0.3);
      width: 110px;
      height: 30px;
      border-radius: 30px 0 0 30px;
      padding-left: 10px;
      box-sizing: border-box;
    }
  }
  .title-text {
    position: absolute;
    top: 115px;
    left: 20px;
    .nerong {
      position: absolute;
      top: 22px;
      left: 20px;
    }
    .nerong-title {
      width: 290px;
      display: flex;
      align-items: center;
      padding: 10px;
      border-bottom: 1px solid #ccc;
      p {
        font-weight: bold;
        margin-left: 10px;
      }
    }
    ul {
      padding: 10px;
      li {
        padding: 9px;
        color: #ccc;
        .spanx {
          color: skyblue;
          /* text-decoration: ;
                    text-decoration: skyblue; */
        }
        span {
          color: #333;
        }
      }
      .tesu {
        margin-left: 33px;
      }
    }
  }
}
</style>